<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "t_forum".
 *
 * @property string $id
 * @property string $course_id 课程id
 * @property string $fullname 名称
 * @property string $description 描述
 * @property int $status 状态：0关闭1开启
 * @property string $create_by 创建者
 * @property string $create_time 创建时间
 * @property string $update_by 更新人
 * @property string $update_time 更新时间
 * @property int $del_flag 删除标识
 * @property string $old_id
 */
class TForum extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 't_forum';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id'], 'required'],
            [['status', 'del_flag'], 'integer'],
            [['create_time', 'update_time'], 'safe'],
            [['id', 'course_id', 'create_by', 'update_by'], 'string', 'max' => 36],
            [['fullname'], 'string', 'max' => 30,'min'=>2,'tooShort'=>'{attribute}最少为2个字符','tooLong'=>'{attribute}最多为30个字符'],
            [['description'], 'string', 'max' => 100,'min'=>10,'tooShort'=>'{attribute}最少为10个字符','tooLong'=>'{attribute}最多为100个字符'],
            [['old_id'], 'string', 'max' => 255],
            [['id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'course_id' => '开课ID',
            'fullname' => '论坛名称',
            'description' => '论坛描述',
            'status' => 'Status',
            'create_by' => '创建者',
            'create_time' => '创建时间',
            'update_by' => 'Update By',
            'update_time' => 'Update Time',
            'del_flag' => 'Del Flag',
            'old_id' => 'Old ID',
        ];
    }
}
